/**
 * 接口主函数
 * @param {Object} ctx HTTP上下文
 * @param {Object} db 数据管理器,如: { next: async function{}, ret: {} }
 * @return {Object} 执行结果
 */
async function main(ctx, db) {
	// 获取请求参数
	var req = ctx.request;
	var {
		query,
		body
	} = req;
	var user = await this.get_state(ctx, db) || {
		user_id: 0,
		nickname: "",
		avatar: ""
	};
	var model = {
		user
	};
	return db.tpl.view("./index.html".fullname(__dirname), model);
};

exports.main = main;